#ifndef DOUBLY_LINKED_LIST_HEADER
#define DOUBLY_LINKED_LIST_HEADER

#ifdef __cplusplus
extern "C"
{
#endif

#include <stdlib.h>

typedef struct _DLL_Element
{
	void *Data;
	struct _DLL_Element *Previous;
	struct _DLL_Element *Next;
}DLL_Element;
/* struct _DLL_Element
{
	void *Data;
	_DLL_Element *Previous;
	_DLL_Element *Next;
};

typedef _DLL_Element DLL_Element;*/

/* This function creates the end of the list with element two,
	and puts it after element one
	Return:
		This function will return a pointer to One
*/
DLL_Element *DLL_AppendElement(DLL_Element *One, DLL_Element *Two);

/* This function will inset an element after one, and shift everything
	along one
	Return:
		This function will return a pointer to One
*/
DLL_Element *DLL_InsertElement(DLL_Element *One, DLL_Element *Two);

/* This function will return the DLL_Element N elements after From
*/
DLL_Element *DLL_GetNthElementFrom(DLL_Element *From, int N);
/* This function goes backward from Before N times and returns the 
	element that is there
*/
DLL_Element *DLL_GetNthElementBefore(DLL_Element *Before, int N);

/* These two functions returns the size until the end from From,
	and until the start from Before respectively
*/
int DLL_GetSizeFrom(DLL_Element *From);
int DLL_GetSizeBefore(DLL_Element *Before);

/* This function will remove all elements between One and Two
*/
DLL_Element *DLL_RemoveElementsBetween(DLL_Element *One, DLL_Element *Two);
/* This function will append ListTwo onto ListOne
	Return:
		This function will return a pointer to One;
*/
DLL_Element *DLL_AppendList(DLL_Element *ListOne, DLL_Element *ListTwo);
/* This function will insert List at At
	Return:
		This function will return a pointer to At
*/
DLL_Element *DLL_InsertList(DLL_Element *At, DLL_Element *List);

/* These functions will get the first and last elements respectivally,
	assuming they have been delimited by NULLs
*/
DLL_Element *DLL_GetFirstElement(DLL_Element *Element);
DLL_Element *DLL_GetLastElement(DLL_Element *Element);

/* This function will swap the elements A and B and return a pointer to A
*/
DLL_Element *DLL_Swap(DLL_Element *A, DLL_Element *B);

#ifdef __cplusplus
}
#endif

#endif
